package collection;

import java.util.ArrayList;
import java.util.Collection;

/**
 * contains:包含
 * remove:删除
 *
 * 集合的某些操作会受元素equals方法影响。比如contains()和remove()
 */
public class CollectionDemo {
    public static void main(String[] args) {
        Collection c = new ArrayList();
        c.add(new Point(1,2));
        c.add(new Point(1,2));
        c.add(new Point(3,4));
        c.add(new Point(5,6));
        c.add(new Point(7,8));
        c.add(new Point(9,10));
        System.out.println(c);
        Point P = new Point(1,2);
        System.out.println("P:"+P);
        boolean contains = c.contains(P);
        System.out.println("包含："+contains);
        c.remove(P);
        System.out.println(c);
    }

}
